package com.itheima.d7_IO.BufferedInputStream;

import java.io.*;

/**
 * 完成一个复制代码
 */
public class Test {
    public static void main(String[] args)  {
        long start = System.currentTimeMillis();
        try(
                InputStream fs = new FileInputStream("E:\\movie\\Pavel_Ales.wmv");
                InputStream bfs = new BufferedInputStream(fs);
                //包装成高级的缓冲流
                OutputStream os = new FileOutputStream("E:\\FileResource\\Empty\\Pavel_Ales.wmv");
                OutputStream bos = new BufferedOutputStream(os);

                ) {
            byte[] bytes = new byte[1024];
            int len;
            while ((len = bfs.read(bytes))!= -1){
                bos.write(bytes,0,len);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        long end = System.currentTimeMillis();
        System.out.println((end-start)/1000 + "秒");
    }
}
